/*
 * client.h
 *
 *  Created on: 5 Dec 2011
 *      Author: marco
 */

#ifndef CLIENT_H_
#define CLIENT_H_

#define CLIENT_COMMAND "Errore: Specificare un nome utente: docars username\n"
#define SOCK_PATH "./tmp/cars.sck"
#define CLIENT_SOCKPATH "./tmp/"
#define SOCKPATH_LEN 6
#define MAX_PID_DIGITS 5

#define EXIT_STRING "%EXIT"
#define HELP_STRING "%HELP"

#define OFFER_PATTERN "*[ A-Z][:]*[ A-Z][:]*[1-9]"
#define REQ_PATTERN "%R[ ]*[ A-Z][:]*[ A-Z]"

#define EXIT 1
#define HELP 2
#define OFFER 3
#define REQ 4
#define ERR 0


int client_init(char *);

void menu();

void* userThread(void*);
void* serverThread(void*);

int parse_input(message_t *);

int signal_handling();

static void sigint_handler(int);

static void sigterm_handler(int);
static void sigpipe_handler(int);//nuovo
static void sigint_handler_main(int signum);



#endif /* CLIENT_H_ */
